package main

import (
	"log"
	"net/http"

	"code.google.com/p/mongorest"
)

func main() {
	if err := mongorest.LoadSettings(""); err != nil {
		log.Fatal(err)
	}
	log.Print("settings loaded: ", mongorest.GetSettings())
	pattern, handler := mongorest.PatternAndHandler()
	http.Handle(pattern, handler)
	addr := mongorest.WebAddr()
	log.Printf("serving at %s", addr)
	http.ListenAndServe(addr, nil)
}
